package com.zyj.mybatis.service;

import org.apache.ibatis.session.SqlSession;

import com.zyj.mybatis.beans.HusbandBean;
import com.zyj.mybatis.mapper.HusbandMapper;
import com.zyj.mybatis.tools.DBTools;

public class OneToOneService {
	public static void main(String[] args) {
        selectHusbandAndWife();
        
    }

    
    private static void selectHusbandAndWife() {
        SqlSession session = DBTools.getSession();
        HusbandMapper hm = session.getMapper(HusbandMapper.class);
        try {
            HusbandBean    husband = hm.selectHusbandById(1);
            System.out.println(husband);
            session.commit();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
